package com.ruoyi.web.controller.warning;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.warning.domain.query.AlertLogQuery;
import com.ruoyi.warning.service.IAlertLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author chenhc
 * @since 2025-03-26
 */
@RestController
@RequestMapping("/alertLog")
@Api(tags = "告警日志", description = "用于处理告警日志相关操作的控制器")
public class AlertLogController {
    @Resource
    private IAlertLogService devicesService;

    @ApiOperation("获取告警日志")
    @Log(title = "查询告警日志", businessType = BusinessType.SELECT)
    @GetMapping(value = "/getAlertLog")
    public R getAlertLog(AlertLogQuery query)
    {
        return R.ok(devicesService.getAlertLog(query));
    }
}
